<?php
include_once '../action/kantorController.php';
include 'z_header.php';
if(!isset($_SESSION['nip'])){
    header('location:login.php');
}
?>
<div class="container">  
    <div class="row">
    <?php if(isset($_GET['view'])) { ?>
    <div class="span10 offset1 accordion-group">
    <div class="span9">
    <form class="form-horizontal" method="post" action="">  
        <fieldset>  
            <legend>PENGATURAN KANTOR</legend>  
            <div class="control-group">  
                <label class="control-label" align="left" for="kd_kppn">KPPN</label>  
                    <div class="controls">  
                        <input type="text" disabled class="input-mini" name="kd_kppn" id="kd_kppn" value="<?php echo $data->kd_kppn ;?>"> &nbsp
                        <input type="text" disabled class="input-xlarge" name="nm_kppn" id="nm_kppn" value="<?php echo $data->nm_kppn ;?>"> 
                    </div>  
            </div>  
            
            <div class="control-group">  
                  <label class="control-label" for="nm_kanwil">Nama Kanwil</label>  
                      <div class="controls">   
                          <input type="text" disabled class="input-xxlarge" name="nm_kanwil" id="nm_kanwil" value="<?php echo $data->nm_kanwil ;?>">    
                      </div>  
            </div> 
            
            <div class="control-group">  
                  <label class="control-label" for="alamat_kppn">Alamat Kantor</label>  
                      <div class="controls">   
                          <input type="text" disabled class="input-xlarge" name="alamat_kppn" id="alamat_kppn" value="<?php echo $data->alamat_kppn ;?>">    
                      </div>  
            </div> 
            
            <div class="control-group">  
                  <label class="control-label" for="telp_kppn">Telepon</label>  
                      <div class="controls">   
                          <input type="text" disabled class="input-xlarge" name="telp_kppn" id="telp_kppn" value="<?php echo $data->telp_kppn ;?>">    
                      </div>  
            </div> 
            
            <div class="control-group">  
                  <label class="control-label" for="fax_kppn">Faksimile</label>  
                      <div class="controls">   
                          <input type="text" disabled class="input-xlarge" name="fax_kppn" id="fax_kppn" value="<?php echo $data->fax_kppn ;?>">    
                      </div>  
            </div> 
            
            <div class="control-group">  
                  <label class="control-label" for="email_kppn">Email</label>  
                      <div class="controls">   
                          <input type="email" disabled class="input-xlarge" name="email_kppn" id="email_kppn" value="<?php echo $data->email_kppn ;?>">    
                      </div>  
            </div> 
            
            <div class="control-group">  
                  <label class="control-label" for="kota_kppn">Kota</label>  
                      <div class="controls">   
                          <input type="text" disabled class="input-medium" name="kota_kppn" id="kota_kppn" value="<?php echo $data->kota_kppn ;?>">    
                      </div>  
            </div> 
            
            <div class="control-group">  
                  <label class="control-label" for="kdpos_kppn">Kode Pos</label>  
                      <div class="controls">   
                          <input type="text" disabled class="input-medium" name="kdpos_kppn" id="kdpos_kppn" value="<?php echo $data->kdpos_kppn ;?>">    
                      </div>  
            </div> 
            <div class="form-actions" align="right"> 
                <td><a href="?ubah&id=<?php echo $data->kd_kppn; ?>"<button class="btn btn-warning"><i class="icon-edit" align="center" ></i> Ubah Kantor</button></a></td>
            </div>  
        </fieldset>  
    </form> 
    </div>
    </div>
    <?php } ?>
    
    <?php if(isset($_GET['ubah'])){?>
    <div class="span7 offset2 accordion-group">
    <div class="span6">
    <form class="form-horizontal" method="post" action=""> 
        <legend>Ubah Kantor</legend>  
            <div class="control-group">  
                <label class="control-label" for="kd_kppn1">KPPN Default</label>  
                    <div class="controls">
                            <select name="kd_kppn1" class="input-xlarge">
                                <?php
                                    foreach($datakantor as $kppn){
                                        if($kppn_default==$kppn->kd_kppn){
                                            echo "<option value=\"".$kppn->kd_kppn."\" selected>".$kppn->nm_kppn."</option>";
                                        }else{
                                            echo "<option value=\"".$kppn->kd_kppn."\">".$kppn->nm_kppn."</option>";
                                        }
                                    }
                                ?>
                            </select>
                        </div>
                <div class="form-actions"> 
                        <a href="pengaturan.kantor.php?view" class="btn">Batal</a>
                        <button type="submit" class="btn btn-primary" name="simpan_kantor" id="simpan_kantor">Simpan</button>  
                </div> 
            </div> 
    </div>
    </form>
    </div>
    <?php } ?>
<?php include_once 'z_footer.php';?>